﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace WpfChart
{
    /// <summary>
    /// AmfChartsMain.xaml 的交互逻辑
    /// </summary>
    public partial class AmfChartsMain : Window
    {
        public AmfChartsMain()
        {
            InitializeComponent();
        }

        public ObservableCollection<TestDataItem> Data { get { return _data; } }

        private ObservableCollection<TestDataItem> _data = new ObservableCollection<TestDataItem>();
        //{
        //    new TestDataItem() { time = "2011-01-01", val=2422},
        //    new TestDataItem() { time = "2011-02-01", val=2423},
        //    new TestDataItem() { time = "2011-03-01", val=2412},
        //    new TestDataItem() { time = "2011-04-01", val=2452}
        //};

        public class TestDataItem
        {
            public string time { get; set; }
            public double val { get; set; }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Random rnd = new Random();
            for (int i = 0; i < 1050; i++)
            {
                _data.Add(new TestDataItem() { time = i.ToString(), val = rnd.Next(2400,2450)});
            }

            this.DataContext = this;
        }

    }
}
